/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.restaurant.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author root
 */
@Entity
@Table(name = "tables")
@XmlRootElement(name = "tables")
@NamedQueries({
    @NamedQuery(name = "Tables.findAll", query = "SELECT t FROM Tables t"),
    @NamedQuery(name = "Tables.findByTableID", query = "SELECT t FROM Tables t WHERE t.tableID = :tableID"),
    @NamedQuery(name = "Tables.findByTablename", query = "SELECT t FROM Tables t WHERE t.tablename = :tablename"),
    @NamedQuery(name = "Tables.findByTablediscription", query = "SELECT t FROM Tables t WHERE t.tablediscription = :tablediscription"),
    @NamedQuery(name = "Tables.findBySittingcapacity", query = "SELECT t FROM Tables t WHERE t.sittingcapacity = :sittingcapacity"),
    @NamedQuery(name = "Tables.findByIsBooked", query = "SELECT t FROM Tables t WHERE t.isBooked = :isBooked"),
    @NamedQuery(name = "Tables.findByIsdeleted", query = "SELECT t FROM Tables t WHERE t.isdeleted = :isdeleted")})
public class Tables implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "TableID")
    private Long tableID;
    @Column(name = "tablename")
    private String tablename;
    @Column(name = "tablediscription")
    private String tablediscription;
    @Column(name = "sittingcapacity")
    private Integer sittingcapacity;
    @Basic(optional = false)
    @Column(name = "isBooked")
    private boolean isBooked;
    @Column(name = "isdeleted")
    private Boolean isdeleted;
    @JoinColumn(name = "tableshape_TableShapeID", referencedColumnName = "TableShapeID")
    @ManyToOne(optional = false)
    private Tableshape tableshape;

    public Tables() {
    }

    public Tables(Long tableID) {
        this.tableID = tableID;
    }

    public Tables(Long tableID, boolean isBooked) {
        this.tableID = tableID;
        this.isBooked = isBooked;
    }

    public Long getTableID() {
        return tableID;
    }

    public void setTableID(Long tableID) {
        this.tableID = tableID;
    }

    public String getTablename() {
        return tablename;
    }

    public void setTablename(String tablename) {
        this.tablename = tablename;
    }

    public String getTablediscription() {
        return tablediscription;
    }

    public void setTablediscription(String tablediscription) {
        this.tablediscription = tablediscription;
    }

    public Integer getSittingcapacity() {
        return sittingcapacity;
    }

    public void setSittingcapacity(Integer sittingcapacity) {
        this.sittingcapacity = sittingcapacity;
    }

    public boolean getIsBooked() {
        return isBooked;
    }

    public void setIsBooked(boolean isBooked) {
        this.isBooked = isBooked;
    }

    public Boolean getIsdeleted() {
        return isdeleted;
    }

    public void setIsdeleted(Boolean isdeleted) {
        this.isdeleted = isdeleted;
    }

    public Tableshape getTableshape() {
        return tableshape;
    }

    public void setTableshape(Tableshape tableshape) {
        this.tableshape = tableshape;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tableID != null ? tableID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tables)) {
            return false;
        }
        Tables other = (Tables) object;
        if ((this.tableID == null && other.tableID != null) || (this.tableID != null && !this.tableID.equals(other.tableID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.restaurant.domain.Tables[tableID=" + tableID + "]";
    }

}
